import React, {Component} from 'react';
import withReg from "../hoc";

class Reg extends Component {
    render() {
        return (
            <div>
                <h4>注册</h4>
                <form onSubmit={this.props.handleSubmit}>
                    用户名：<input name={'userName'} onChange={this.props.handleChange} value={this.props.formData.userName} type='text'/>
                    密码：<input name={'pwd'} onChange={this.props.handleChange} value={this.props.formData.pwd} type='password'/>
                    重写密码：<input name={'repwd'} onChange={this.props.handleChange} value={this.props.formData.repwd} type='password'/>
                    <button>提交</button>
                </form>
            </div>
        );
    }
}

export default withReg(function () {
    return {userName:'张三',pwd:'123456',repwd:'123456'}
})(Reg);